﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using OF.Common;
using System.Data;

namespace OF.Web.user
{
    public partial class login : BuyerAdminPage
    {
        OF.BLL.User.User bll_buyer = new BLL.User.User();
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnLogin_Click(object sender, EventArgs e)
        {
            int id = bll_buyer.doWebValidLogin(txtname.Text, txtpwd.Text); //Utils.Md5(txtpwd.Text)
            if (id!=0)
            {
                WebUtils.AddBuyerSession(txtname.Text,id.ToString());
                string temp = Common.Cookie.getCookie("ordershop");
                if (string.IsNullOrWhiteSpace(temp))
                    Response.Redirect("/user/index.aspx");
                else
                    Response.Redirect("/order.aspx");
            }
            else {
                MessageBox.Show(this,"登陆失败");
            }
         
        }
    }
}